<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import ContentView from './components/ContentView'
import * as cookie from '../src/js/cookie'
export default {
  name: 'App',
  data () {
    return {

    }
  },
  components: {
    // 加载侧边栏组件
    ContentView
  },
  created () {
    // 判断用户是否登录
    var userName = cookie.getCookie('userName')
    if (userName === '' || userName == null) {
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped>
#app {
  width: 100%;
  height: 100%;
  background: rgba(240, 242, 245, 1);
}
</style>
